<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>店铺设计</title>
		<script src="../js/mui.min.js"></script>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<link rel="stylesheet" href="../css/style.css" />
		<link rel="stylesheet" href="../css/member.css" />
		<link rel="stylesheet" href="../css/picker.css" />
		<link rel="stylesheet" href="../css/poppicker.css" />
		<link rel="stylesheet" type="text/css" href="../css/datepicker3.css" />
		<script src="../plugin/crop/croppie.min.js"></script>
		<link rel="stylesheet" href="../css/font-awesome.min.css" />
		<link rel="stylesheet" href="../css/bootstrap.min.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a id="shan" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title" id='d'>店铺设计</h1>
		</header>
		<div class="mui-content ">
			<div class="gerenzl_nr">
				<form class="mui-input-group gerenzl_group">
					<div class="gerenzl_top img-click">
						<div class="actions">
							<button class="file-btn" style="width: 60%; height: 30px;">
				                <span><i class=" fa fa-plus"></i></span>
				                <input type="file" id="upload" value="选择图片文件" multiple />
				            </button>
				            <div>店铺导航图</div>
							<div id="img_list" class="img_list">
							</div>
						</div>
						
					</div>
					
				</form>
				<div class="gerzl_btn" id="btn" onclick="func1()">
					<a href="#" id="z">保存</a>
				</div>
			</div>
			<input type="hidden" id="member_id">
			<!--<input type="hidden" id="gui" value="1">-->
		</div>

	</body>

</html>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-datepicker.js"></script>
<script src="../js/layer/layer.min.js"></script>
<script src="../js/castapp.js"></script>
<script src="../js/app.js"></script>
<script src="../js/picker.js"></script>
<script src="../js/poppicker.js"></script>
<script src="../js/city.data-3.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script>

var member=JSON.parse(localStorage.getItem('member'));
		$(function() {
			dlpd();
		$('#upload').on('change', function() {
			
			readFile(this, "thumb", 1,10);
		//	$(".file-btn").hide();
		});
		//显示需要编辑得内容
$.ajax({
		type:"post",
		url:APP.api_url + "member/pic_dd",
		data:{
			'id':member['id'],
		},
		dataType:'jsonp',
		success:function(data){
			if(data.data!=''){
				for(var i=0; i<data.data.length;i++){
	              	var innerHTML = '<div class="images-item">' +
					'	<span class="del">×</span>' +
					'	<img style="width: 90%;height: 150px; margin:0 auto;" src="' + APP.pic_url +data.data[i]+ '"/>' +
					'	<input calss="pic" type="hidden" name="pic_d" value="'+data.data[i]+'" />'+
					'	<input id="p" type="hidden" name="'+name+'1" value="'+i+'" />'+
					'</div>';
					$("#img_list").append(innerHTML);
					del_event();
			}
			}
		},
	
	});	
		
		
	});
		function func1(){
			var x=document.getElementsByName("pic_d");	
			var pic_d="";
			for(var i=0 ;i<x.length;i++){
				if(i==0){
					pic_d+=x[i].value;
				}else{
					pic_d+='@'+x[i].value;
				}
				
			}
		$.ajax({
		type:"post",
		url:APP.api_url + "member/pic_dao",
		data:{
			'id':member['id'],
			'pic_d':pic_d,

		},
		dataType:'jsonp',
		success:function(data){
			layer.msg(data.msg, {icon: 1,time:1500,shade: 0.1}, function(index){
                    window.location.href="";
                   });
		},
	
	});	
		}
		
	
	$("#shan").click(function() {
		location.href = "shopguan.html";
	});
	
</script>
